package com.zhuiyun.pm.client.login.controller;/**
 * @author syc
 * @date 2023/4/2 18:04
 */

import com.zhuiyun.pm.client.login.service.ChatRecordService;
import com.zhuiyun.pm.config.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName ChatRecordController
 * @Description TODO
 * @Author sgo
 * @Date 2023/4/2 18:04
 **/
@RestController
@CrossOrigin
@RequestMapping("/chatRecord")
public class ChatRecordController {
    @Autowired
    ChatRecordService chatRecordService;
    /**
    * @Author sgo
    * @Description 查询聊天记录
    * @Date 2023/4/2 18:13
    * @Return com.zhuiyun.pm.config.CommonResult
    * @param fromUserName
    * @param toUserName
    */
    @GetMapping("/getUserChatRecord")
    public CommonResult getUserChatRecord(String fromUserName,String toUserName){
        return chatRecordService.getUserChatRecord(fromUserName,toUserName);
    }
}
